home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 202_01 / sessions.doc < prev    next >
Text File  |  1980-01-01  |  12KB  |  867 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.                                 Editing Session I
  33.  
  34.                               To create a new file
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.                                       - 1 -
  63.           
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.           A>ked b:blue1 b:blue2
  76.           TYPE MN TO SEE MENU
  77.           BEGINNING-OF-PROGRAM
  78.             <instruction>df
  79.             DEFINE-NEW-INSTRUCTION <new-name>AStr
  80.             DEFINE-NEW-INSTRUCTION tr AS
  81.               BEGIN
  82.                 <instruction>tl
  83.                 turnleft;
  84.                 <instruction>tl
  85.                 turnleft;
  86.                 <instruction>tl
  87.                 turnleft;
  88.                 <instruction>nd
  89.               END;
  90.             <instruction>bx
  91.             BEGINNING-OF-EXECUTION
  92.               <instruction>m
  93.               move;
  94.               <instruction>if
  95.               IF <test>c
  96.               IF next-to-a-beeper
  97.                 THEN
  98.                   <instruction>b
  99.                   BEGIN
  100.                     <instruction>pi
  101.                     pickbeeper;
  102.                     <instruction>m
  103.                     move;
  104.                     <instruction>tr
  105.                     tr;
  106.                     <instruction>nd
  107.                   END;
  108.                 <instruction>el
  109.                 ELSE
  110.                   <instruction>m
  111.                   move;
  112.                   <instruction>ndc
  113.                 <instruction>m
  114.               move;
  115.               <instruction>to
  116.               turnoff;
  117.               <instruction>ndx
  118.             END-OF-EXECUTION
  119.           END-OF-PROGRAM
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                                       - 2 -
  129.           
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.           ?t
  141.           BEGINNING-OF-PROGRAM
  142.           ?n
  143.           ?DEFINE-NEW-INSTRUCTION ?n
  144.           tr AS
  145.           ?d
  146.           ENTER REPLACEMENT <new-name>turnright
  147.             DEFINE-NEW-INSTRUCTION turnright AS
  148.           ?t
  149.           BEGINNING-OF-PROGRAM
  150.           ?l
  151.           BEGINNING-OF-PROGRAM
  152.             DEFINE-NEW-INSTRUCTION turnright AS
  153.               BEGIN
  154.                 turnleft;
  155.                 turnleft;
  156.                 turnleft
  157.               END;
  158.             BEGINNING-OF-EXECUTION
  159.               move;
  160.               IF next-to-a-beeper
  161.                 THEN
  162.                   BEGIN
  163.                     pickbeeper;
  164.                     move;
  165.                     turnright;
  166.                   END
  167.                 ELSE
  168.                   move;
  169.               move;
  170.               move;
  171.               turnoff
  172.             END-OF-EXECUTION
  173.           END-OF-PROGRAM
  174.           END OF FILE
  175.           ?s
  176.           ?q
  177.           HAS PROGRAM BEEN SAVED ? (Y/N)
  178.           y
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.                                       - 3 -
  195.           
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.                                Editing Session II
  231.  
  232.                                 To correct errors
  233.                                  in an old file
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.                                       - 4 -
  261.           
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.           A>ked b:blue1 b:blue2
  274.           BEGINNING-OF-PROGRAM
  275.             DEFINE-NEW-INSTRUCTION turnright AS
  276.               BEGIN
  277.                 turnleft;
  278.                 turnleft
  279.               END;
  280.             BEGINNING-OF-EXECUTION
  281.               move;
  282.               IF next-to-a-beeper
  283.                 THEN
  284.                   BEGIN
  285.                     pickbeeper;
  286.                     move;
  287.                     turnleft
  288.                   END
  289.                 ELSE
  290.                   move;
  291.               move;
  292.           ?t
  293.           BEGINNING-OF-PROGRAM
  294.           ?nc
  295.             DEFINE-NEW-INSTRUCTION ?nc
  296.             BEGINNING-OF-EXECUTION
  297.           ?n-
  298.                 END;
  299.           ?i
  300.           ?tl
  301.                   turnleft;
  302.                   <instruction>nc
  303.             BEGINNING-OF-EXECUTION
  304.           ?nc
  305.               IF ?nc
  306.                 THEN
  307.           ?nc
  308.                 ELSE
  309.           ?n-
  310.                   END
  311.           ?n-
  312.                     turnleft
  313.           ?d
  314.                     turnleft
  315.           ?i
  316.           ?turnright
  317.                     turnright;
  318.                     <instruction>t
  319.           BEGINNING-OF-PROGRAM
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.                                       - 5 -
  327.           
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.           ?l
  339.           BEGINNING-OF-PROGRAM
  340.             DEFINE-NEW-INSTRUCTION turnright AS
  341.               BEGIN
  342.                 turnleft;
  343.                 turnleft;
  344.                 turnleft
  345.               END;
  346.             BEGINNING-OF-EXECUTION
  347.               move;
  348.               IF next-to-a-beeper
  349.                 THEN
  350.                   BEGIN
  351.                     pickbeeper;
  352.                     move;
  353.                     turnright
  354.                   END
  355.                 ELSE
  356.                   move;
  357.               move;
  358.               move;
  359.               turnoff
  360.             END-OF-EXECTION
  361.           END-OF-PROGRAM
  362.           END OF FILE
  363.           ?s
  364.           ?q
  365.           HAS PROGRAM BEEN SAVED? (Y/N)
  366.           y
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.                                       - 6 -
  393.           
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.                                Editing Session III
  429.  
  430.                               To illustrate insert
  431.                            and delete features of KED
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.                                       - 7 -
  459.           
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.           A>ked b:blue1 b:blue2
  472.           BEGINNING-OF-PROGRAM
  473.             DEFINE-NEW-INSTRUCTION turnright AS
  474.               BEGIN
  475.                 turnleft;
  476.                 turnleft;
  477.                 turnleft
  478.               END;
  479.             BEGINNING-OF-EXECUTION
  480.               move;
  481.               IF next-to-a-beeper
  482.                 THEN
  483.                   BEGIN
  484.                     pickbeeper;
  485.                     move;
  486.                     tunrnright
  487.                   END
  488.                 ELSE
  489.                   move;
  490.               move;
  491.           ?t
  492.           BEGINNING-OF-PROGRAM
  493.           ?nc
  494.             DEFINE-NEW-INSTRUCTION ?nc
  495.             BEGINNING-OF-EXECUTION
  496.           ?nc
  497.               IF ?n
  498.           next-to-a-beeper
  499.           ?d
  500.           ENTER REPLACEMENT <test>f
  501.               IF front-is-clear
  502.           ?t
  503.           BEGINNING-OF-PROGRAM
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.                                       - 8 -
  525.           
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.           ?l
  537.           BEGINNING-OF-PROGRAM
  538.             DEFINE-NEW-INSTRUCTION turnright AS
  539.               BEGIN
  540.                 turnleft;
  541.                 turnleft;
  542.                 turnleft
  543.               END;
  544.             BEGINNING-OF-EXECUTION
  545.               move;
  546.               IF front-is-clear
  547.                 THEN
  548.                   BEGIN
  549.                     pickbeeper;
  550.                     move;
  551.                     turnright
  552.                   END
  553.                 ELSE
  554.                   move;
  555.               move;
  556.               move;
  557.               turnoff
  558.             END-OF-EXECUTION
  559.           END-OF-PROGRAM
  560.           END OF FILE
  561.           ?n-
  562.               turnoff
  563.           ?i
  564.           ?it
  565.               ITERATE <positive-number> TIMES4
  566.               ITERATE  4 TIMES
  567.                 <instruction>b
  568.                 BEGIN
  569.                   <instruction>wh
  570.                   WHILE <test> DOb
  571.                   WHILE any-beepers-in-beeper-bag DO
  572.                     <instruction>pu
  573.                     putbeeper;
  574.                     <instruction>ndc
  575.                   <instruction>m
  576.                   move;
  577.                   <instruction>nd
  578.                 END;
  579.               <instruction>t
  580.           BEGINNING-OF-PROGRAM
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.                                       - 9 -
  591.           
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.           ?l
  603.           BEGINNING-OF-PROGRAM
  604.             DEFINE-NEW-INSTRUCTION turnright AS
  605.               BEGIN
  606.